﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DevExpress.Web.ASPxGridView;

namespace SGDemo.Web.Views.Permission.Popup
{
    public partial class SelectRole : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            this.gvwList.SettingsBehavior.AllowSelectSingleRowOnly = (this.Request.QueryString["SelectionMode"] == "Single");
        }
        protected string ProcessRoleType(string roleType)
        {
            if (roleType == "0") { return "一级"; }
            if (roleType == "1") { return "二级"; }
            if (roleType == "2") { return "三级"; }
            if (roleType == "3") { return "四级"; }
            if (roleType == "4") { return "五级"; }
            if (roleType == "5") { return "六级"; }
            return string.Empty;
        }

        /// <summary>
        /// 自定义GridView回调重新绑定
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void gvwList_CustomCallback(object sender, ASPxGridViewCustomCallbackEventArgs e)
        {
            gvwList.PageIndex = 0;
            gvwList.DataBind();
        }
    }
}